Skip to content

Use try-with-resources in WKT and WKB readers#1210

Merged
dr-jts merged 1 commit into
locationtech:masterfrom
Oz-er:master
Jul 1, 2026
Merged

Use try-with-resources in WKT and WKB readers#1210
dr-jts merged 1 commit into
locationtech:masterfrom
Oz-er:master

Conversation

@Oz-er

@Oz-er Oz-er commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR simplifies resource management in WKTFileReader and WKBHexFileReader.

Changes

  • Replaced nested try/finally blocks with try-with-resources.
  • Kept reader cleanup behavior unchanged.
  • Kept the change localized to the two reader classes.

Rationale

Both classes used similar manual resource-closing logic. Try-with-resources makes the cleanup behavior clearer and
less error-prone while preserving existing behavior.

Validation

Ran:

mvn -pl modules/core verify

Result:

- Checkstyle: 0 violations
- Tests run: 2294
- Failures: 0
- Errors: 0
- PMD completed
- Build successful

Signed-off-by: Omer <omerwork3388@gmail.com>
@dr-jts

dr-jts commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Good improvement, thanks.

@dr-jts dr-jts merged commit 909d8b2 into locationtech:master Jul 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants